package com.lagouedu.demoredis.controller;

import com.lagouedu.demoredis.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import redis.clients.jedis.JedisCluster;

@RestController
public class MenusController {

    @Autowired
    private MenuService menuService;

    @Autowired
    private JedisCluster jedisCluster;

    @RequestMapping("/get/menus")
    public String getMenus(){
        return menuService.getMenus();
    }

    @RequestMapping("/del/redis/menus")
    public String invalidRedisMenus(){
        jedisCluster.del("menus");
        return "删除rediscluster menus数据";
    }

}
